#ifndef NETINTERFACE_H
#define NETINTERFACE_H
#include "SingleStream.h"

/**
 * Initialize communication.
 */
void Net_Init();

/**
 * Start UDP comunication with another computer.
 * @param IP [in]IP of remote computer
 * @param Port [in]Port of remote computer
 * @param Out [in]Output stream for sending packets
 * @param Loc_Port [in]Local port for listening
 * @param In [in]Input stream for receiving the packets from remote computer
 * @return true for succeed or false for failure
 */
bool Net_Start(char* IP,char* Port,CSingleStream* Out,char* Loc_Port,CSingleStream* In);

/**
 * End current UDP comunication.
 */
void Net_End();

/**
 * Uninitialize communication and free resources.
 */
void Net_Uninit();

/**
 * Change the format of receiving frames.
 * @param type [in]identify of formats,from 1 to 4;
 */
void Net_Change_Format(int type);

/**
 * Get count of received bytes.
 * @return received count in all
 */
uint64_t Net_Get_Received_Byte_Count();

/**
 * Get count of sent bytes.
 * @return sent count in all
 */
uint64_t Net_Get_Sent_Byte_Count();

#endif